import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * 经典管道流的方式
 */
public class BufferedReaderTest {
    public static void main(String[] args) throws IOException {
        String fileName = "src/main/resources/static/TestReaderFile.txt";
        //带缓冲的流读取，默认缓冲8k
        try {
            BufferedReader br = new BufferedReader(new FileReader(fileName));
            String line;
            while ((line = br.readLine()) != null){
                System.out.println(line);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
